package net.osweb.core.tools.utils.crm;

import net.osweb.core.fw.exception.ServiceException;


public class Assert {
	
	public static void isNull(Object object) {
		isNull(object, "[g2school Assertion failed] - the object argument must not be null");
	}

	public static void isNull(Object object, String message) {
		if (object == null) {
			throw new ServiceException(message);
		}
	}
	public static void isEmpty(String str) {
		isEmpty(str ,"[g2school Assertion failed] - the str argument must not be null or empty");
	}
	
	public static void isEmpty(String str, String message) {
		if(str == null || str.trim().length() <= 0){
			throw new ServiceException(message);
		}
	}
	
	public static boolean validateEmpty(String str){
		return (str == null || str.trim().length() <= 0);
	}
	public static boolean validateNull(Object object){
		return (object == null);
	}
}
